﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="wfForgotPassword1.aspx.cs" Inherits="msBsc.WebUi.wMall.Public.wfForgotPassword1" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>忘记密码</title>
    <link href="/themes/wStyle1/css/sLayout.css" rel="stylesheet" />
    <link href="/themes/wStyle1/css/sHead.css" rel="stylesheet" />
    <link href="/themes/wStyle1/css/sFoot.css" rel="stylesheet" />
    <link href="/themes/wStyle1/css/Public/sForgotPassword.css" rel="stylesheet" />
</head>
<body>
    <div class="wf_all">
        <div id="divLoginInfo">
            <%=msBsc.WebUi.Code.QtHtmlGet.GetHeaderLoginInfo() %>
        </div>
        <div class="password_box">
            <div class="hd">
                <h2 class="hd_title">找回密码</h2>
            </div>
            <div class="password">
                <div class="flowsteps">
                    <ol class="num4">
                        <li class="first current">
                            <span>
                                <i>1</i>
                                <em>输入账户名</em>
                            </span>
                        </li>
                        <li>
                            <span>
                                <i>2</i>
                                <em>验证身份</em>
                            </span>
                        </li>
                        <li>
                            <span>
                                <i>3</i>
                                <em>重置密码</em>
                            </span>
                        </li>
                        <li class="last">
                            <span>
                                <i>4</i>
                                <em>完成</em>
                            </span>
                        </li>
                    </ol>
                </div>
                <div class="kv_list">
                    <div class="kv_item">
                        <span class="kv_label">账户名</span>
                        <input id="J_username_input" class="i_text" type="text" value="" name="accountName">
                        <span id="J_username_ph" class="place_holder" style="display: inline; position: absolute; left: 653.5px; top: 264.8px;">请输入您的账户名</span>
                    </div>
                    <div class="kv_item">
                        <span class="kv_label">验证码</span>
                        <input id="J_checkcode_input" class="i_textshort" type="text" autocomplete="off" maxlength="4" value="" name="checkCode">
                        <div id="imgValidata" class="img_validata"></div>
                        <%--<img id="J_checkcode" width="100" height="26" style="cursor: pointer" onclick="ChangeValidata()">--%>
                    </div>
                    <div class="kv_item">
                        <button class="btn" type="button" onclick="Accounts(0,this)">下一步 </button>
                    </div>
                </div>
                <div class="kv_list" style="display: none;">
                    <div class="kv_item">
                        <span class="kv_label">邮箱</span>
                        <input id="J_useremail_input" class="i_text" type="text" value="" readonly="true" name="emali">
                    </div>
                    <div class="kv_item">
                        <input id="J_btn_phone_code" class="btn_graylong" type="button" onclick="SendEmail()" value="免费获取重置路径" />
                    </div>
                </div>
            </div>
        </div>
        <!--start JS引用-->
        <script src="/jqPlugin/js/jquery-1.8.3.min.js"></script>
        <script src="/jqPlugin/js/jBase.js"></script>
        <script src="/jqPlugin/js/jBPage.js"></script>
        <script src="/jqPlugin/js/laytpl.js"></script>
        <script src="/themes/wStyle1/js/comm/VerifyJs.js"></script>
        <script type="text/javascript">
            (function () {
                jQuery.getValidateImg('imgValidata');

                $("#J_username_input").val("");
                $("#J_checkcode_input").val("");
                $("#J_useremail_input").val("");
                $("#J_emailcode_input").val("");
                $("#J_username_input").live("focus", function () {
                    $("#J_username_ph").hide();
                });
                $("#J_username_input").live("blur", function () {
                    if (IsNull($(this).val())) {
                        $("#J_username_ph").show();
                    }
                })
            })()
            var userCode = "", userName="";
            function btnDo(sEbtn) {
                GtGrid1Action = sEbtn;
                var opart = new jsonRow();
                opart.AddCell("ACTION", GtGrid1Action);
                if (sEbtn=="userCode") {
                    opart.AddCell("Code", userCode);
                    opart.AddCell("userName", userName);
                }
                ajaxComm(opart);
            };

            function firstNext(index) {
                $(".num4 li").eq(index).removeClass("current");
                $(".num4 li").eq(index).addClass("done");
                $(".num4 li").eq(index + 1).addClass("current");
                $(".kv_list").hide();
                $(".kv_list").eq(index + 1).show();
            }

            function Accounts() {
                userName = $("#J_username_input").val();
                if (!vfcUser(userName)) {
                    return;
                }
                userCode = $("#J_checkcode_input").val();
                if (!vfcCode(userCode)) {
                    return;
                }
                btnDo("userCode");               
            }

            function SendEmail()
            {
                var account = $("#J_username_input").val();
                var email = $("#J_useremail_input").val();
                var opart = new jsonRow();
                opart.AddCell("ACTION", "sendEmail");
                opart.AddCell("account", account);
                opart.AddCell("email", email);
                ajaxComm(opart);
            }

           

            //验证用户名
            function vfcUser(UserNameStr) {
                if (IsNull(UserNameStr)) {
                    alert("账户名不能为空");
                    return false;
                }
                if (!IsEmail(UserNameStr)) {
                    alert("账户名只能是邮箱");
                    return false;
                }
                return true;
            }

           

            //验证验证码
            function vfcCode(ValidataCode) {
                if (ValidataCode.length != 4) {
                    alert("验证码长度只能是四位");
                    return false;
                }
                if (!isStr(ValidataCode)) {
                    alert("验证码只能是数字和字母组合");
                    return false;
                }
                return true;
            }
        </script>
        <!--end JS引用-->
        <%=msBsc.WebUi.Code.QtHtmlGet.GetFloorHtml() %>
    </div>
</body>
</html>
